public class ThreadDemo {

    public static void main(String[] args) {
        new MyThread().start();
        new MyRunnable().run();
    }
}

class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("我是一个线程，我叫：" + Thread.currentThread().getName());
    }
}

class MyRunnable implements Runnable {

    @Override
    public void run() {
        System.out.println("我是一个线程，我叫：" + Thread.currentThread().getName());
    }
}
